package com.demo.service.impl;

import com.demo.bean.Student;
import com.demo.service.CacheTestOne;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class CacheTestOneImpl implements CacheTestOne{
    private final HashMap<Integer,Student> hashMap=new HashMap<>();

    @Override
    public void putCache(Integer id, Student student) {
        hashMap.put(id,student);
    }

    @Override
    public Student gainCache(Integer id) {
        return hashMap.get(id);
    }

}
